<?php $this->load->view('public/member_pubnav');?>
<!-- 专辑详情页-->
<div id="main">
    <div id="topbox">   
        <div id="says">
            <span id="time"><?php if(!empty($result['updatetime'])) echo $result['updatetime'];?></span>
            <div class="clr"></div>
            <span id="tit"><?php if(!empty($result['titel'])) echo $result['title'];?></span>
            <div class="clr"></div>
            <p id="content"><img width="70px" height="70px" src="<?php if(!empty($result['img'])){ echo base_url();?>upload/column/<?php echo $result['img'];}?>" /><img src="<?php echo base_url();?>images/column/yinhao.jpg"><?php if(!empty($result['desc'])){ echo $result['desc'];}else{?>这个专辑太棒啦，主人无法用语言来描述啦！<?php }?><img src="<?php echo base_url();?>images/column/yinhao.jpg"></p>
        </div>

        <div id="minute">
            <div class="user_blck">
                <div class="user_img"><img src="<?php echo base_url();?>images/column/dress1.jpg"></div>
                <div class="user_num">
                    <div class="baobei"><a href="#">宝贝</a></div>
                    <div class="baobei1"><a href="#"><?php echo $baby_nums;?></a></div>
                </div>
            </div>
            <div class="clr"></div>
            <div class="xian_1"></div>
            <div class="clr"></div>
        </div>
    </div>
</div>
<div class="clr1"></div>
<?php 
	$uid = $this->session->userdata('member_id') ? $this->session->userdata('member_id') : '';
	if($uid == $mem_info['id']){
?>
<div id="handle">
    <div class="small_handle"><a href="<?php echo base_url();?>column/column_edit/<?php echo $result['id'];?>">编辑专辑</a></div>
    <div class="small_handle"><a href="<?php echo base_url();?>column/column_delete/<?php echo $result['id'];?>" onclick="return confirm('确认删除？');">删除专辑</a></div>
    <div style="clear:both;margin-left:400px;">
		<form action="<?php echo front_url('column/baby_like_add')?>" method="post" >
		    <input type="text" name="baby_url" placeholder="输入宝贝链接，加入本专辑吧~" style="width:600px;height:25px;"/>
		    <input type="text" name="desc" placeholder="来点儿宝贝描述吧~" style="width:600px;height:25px;"/>
		    <input type="hidden" name="column_id" value="<?php echo $result['id'];?>"/>
		    <input type="submit" value="加入专辑" style="margin-left:5px;background: none repeat scroll 0 0 #FF3366;height: 30px;text-align: center;width: 80px;"/>
		</form>
	</div>
</div>
<?php }?>
<div class="clr1"></div>
<section id="wrapper">
<div id="container">
	<?php 
		$baby = $this->like_baby->get_list(array('column_id'=>$result['id'],'liker_id'=>$mem_info['id']));
		if(!empty($baby)){
			foreach($baby as $bk => $bv){
				$one_baby = $this->baby->get_one_list($bv['baby_id']);
				$like_baby_count = count($this->like_baby->get_list(array('baby_id'=>$bv['baby_id'])));
	?>
	<div class="nobox block description">
		<a href="<?php echo front_url('index/baby_detail').'/'.$one_baby['id'];?>" target="_blank"><img src="<?php echo base_url();?>upload/baby/<?php echo $one_baby['big_img'];?>"></a>
        <div class="xiaoxi">
        
        <div class="xiaoxi1 <?php if(!empty($uid)){echo 'like_baby';} else {echo 'notin';}?>" baby_id="<?php echo $bv['baby_id'];?>"><img src="<?php echo base_url();?>images/column/like1.jpg"></div>
	        <font class="show_like_success"></font>
	        <font class="show_like_num"><?php echo $like_baby_count;?></font>人喜欢

		</div>
		<div class="clr1"></div>
		<p><?php echo $bv['addtime'];?></p>
	</div>
	<?php }}else{?>
      <img style="margin-left:50%;" src="<?php echo base_url();?>images/publick/empty_column.jpg">
	<?php }?>
	<div class="clr1"></div>
</div>
</section>
<script type="text/javascript">
    $(document).ready(function(){
        $('.like_baby').click(function(){
            $baby_id = $(this).attr('baby_id');
            thats = $(this);
            $.ajax({
                type:"POST",
                url:"<?php echo base_url().'column/like_baby'?>",
                dataType:"json",
                data:{"baby_id":$baby_id},
                success:function(data){
                    thats.parents('.xiaoxi').find('.show_like_success').html(data.error);
                    thats.siblings('.show_like_num').html(data.like_num);
                    //return ;
                }
            })
        });
        $('.notin').click(function(){
            alert('小主，登录之后可以喜欢这宝贝哟~');
            //return false;
        });
        
    })

</script>
<script type="text/javascript">
    function bookmarksite(title, url){
        if (document.all)
            window.external.AddFavorite(url, title);
        else if (window.sidebar)
            window.sidebar.addPanel(title, url, "")
    }
</script>
<?php $this->load->view('public/member_pubfooter');?>
